<?php
/**
 * initialise block
 * 
 * @author       The PostNuke Development Team
 */
function InnoForum_ListTopTopicsblock_init()
{

}

/**
 * get information on block
 * 
 * @author       The PostNuke Development Team
 * @return       array       The block information
 */
function InnoForum_ListTopTopicsblock_info()
{
    return array('text_type'      => 'List Top Topic',
                 'module'         => 'InnoForum',
                 'text_type_long' => 'Show top topics of OnnoTopics',
                 'allow_multiple' => true,
                 'form_content'   => false,
                 'form_refresh'   => false,
                 'show_preview'   => true);
}

/**
 * display block
 * 
 * @author       The PostNuke Development Team
 * @param        array       $blockinfo     a blockinfo structure
 * @return       output      the rendered bock
 */
function InnoForum_ListTopTopicsblock_display($blockinfo)
{
    // Populate block info and pass to theme
    $blockinfo['content'] = "display";

    return themesideblock($blockinfo);
}


/**
 * modify block settings
 * 
 * @author       The PostNuke Development Team
 * @param        array       $blockinfo     a blockinfo structure
 * @return       output      the bock form
 */
function InnoForum_ListTopTopicsblock_modify($blockinfo)
{

	return "modify";
}


/**
 * update block settings
 * 
 * @author       The PostNuke Development Team
 * @param        array       $blockinfo     a blockinfo structure
 * @return       $blockinfo  the modified blockinfo structure
 */
function InnoForum_ListTopTopicsblock_update($blockinfo)
{
    
    // Get current content
    $vars = pnBlockVarsFromContent($blockinfo['content']);

    // alter the corresponding variable
    $vars['btype'] = "hello";

    // write back the new contents
    $blockinfo['content'] = pnBlockVarsToContent($vars);

    // clear the block cache
    /*
    $pnRender = pnRender::getInstance('InnoForum');
    $pnRender->clear_cache('banners_block_banners.htm');
    */
    return $blockinfo;
}
